// TOWN DIALOGUE SCRIPT
//    Town 99: Dryad Grove

begintalkscript;

variables;

short i,j,k,r1,choice;

// Esselarea

begintalknode;
	tag = 40;
	state = -1;
	nextstate = 1;
	question = "Esselarea";
	text1 = "You meet a dryad. She is a beautiful, delicate, feminine creature of the woods, and her hair and skin are tinted a lovely chlorophyll green.";
	text2 = "Yet, she isn't as peaceful and carefree as dryads are supposed to be. She is quite distraught. _I am Esselarea,_ she says, her voice choked with grief.";
	text5 = "Esselarea is still distraught. She has recently been crying. _Oh, wanderers, please tell me my glade is free of intruders!_";
	action = INTRO;
		

begintalknode;
	state = 1;
	nextstate = 2;
	question = "_Why are you so upset?_";
	text1 = "_I am trying to regain my grove! It has been taken!_ Fresh tears begin to run down her face.";

begintalknode;
	state = 2;
	nextstate = 3;
	question = "_What happened to your grove?_";
	text1 = "She stamps her foot in fury. _A fierce ogre snuck in and scared me out! A dryad's grove is her life. I'm trying to figure out how to remove the horrible creature. Oh, how I wish someone would get rid of it for me._";
	action = SET_SDF 99 11 1;
	code =
		toggle_quest(53,1);
	break;
	
begintalknode;
	state = 3;
	nextstate = 4;
	question = "_Have you had any ideas about how to remove the ogre?_";
	text1 = "She wails. _Noooo. He's a horrid beast, the biggest I've ever seen. It's in there now, burning my trees and killing my pets. Oh, how I'd reward someone who slew it!_";

begintalknode;
	state = 4;
	nextstate = -1;
	question = "_How do you know what it is doing?_";
	text1 = "_You don't know much, do you? A dryad is linked to her grove. I feel the death of every tree and every animal. If something isn't done to the ogre soon, I'll be done for!_";

begintalknode;
	state = 4;
	nextstate = 5;
	question = "_What reward will you offer or the slaying of the ogre?_";
	text1 = "Her tears dry up, replaced by a furious gaze. _The ogre stole some of my trinkets. Whoever slew it could have them. But there's a problem._";

begintalknode;
	state = 5;
	nextstate = -1;
	question = "_What kinds of trinkets did he steal?_";
	text1 = "_Gold. Magic items. That sort of thing. Nothing as important as a tree._";

begintalknode;
	state = 5;
	nextstate = 6;
	question = "_What problems?_";
	text1 = "_One of you can enter my glade to the east. But only one of you. My glade is surrounded by magical defenses, but they are working against me now. Only one outsider can enter. That was how that one ogre got in._";
	text2 = "_Please, please, please, will one of you accept this quest?_";

begintalknode;
	state = 6;
	nextstate = -1;
	question = "_Perhaps I can help._";
	text1 = "_If you do, just go through the magical door to the northeast. It is the entrance to my glade. My hopes go with you!_ She blushes, and then starts to cry again.";
	action = END_TALK;

begintalknode;
	state = 6;
	nextstate = -1;
	question = "_I will not help you. I'm too busy._";
	text1 = "_No! You're lazy and bad and mean! You should just go!_ You suddenly find yourself somewhere else.";
	action = END_TALK;	
	code =
		relocate_char(get_pc_id(0),50,40,FALSE);
		relocate_char(get_pc_id(1),51,40,FALSE);
		relocate_char(get_pc_id(2),51,41,FALSE);
		relocate_char(get_pc_id(3),50,41,FALSE);
	break;


begintalknode;
	state = 1;
	nextstate = -1;
	condition = gf(99,7) >= 1;
	question = "_The ogre is dead. Your glade is yours again._";
	text1 = "_Hooray! You are so kind! Thank you so much! I hope you collected your reward. I have to go. There's so much damage to repair. Thank you again!_";
	text2 = "She fades into the trees. Before you have time to say anything, she is gone.";
	action = END_TALK;
	code =
		sf(99,11,2);
		toggle_quest(53,10);
		award_party_xp(MED_QUEST_XP,15);
		erase_char(9901);
	break;

// First Gremlin

begintalknode;
	tag = 60;
	state = -1;
	nextstate = 29;
	question = "First Gremlin";
	text1 = "A nasty little gremlin is grinning at you. _I'm a gremlin! You're an intruder here! But I don't need to kill you! Yet!_";
	text5 = "The nasty little gremlin is grinning at you. ";
	action = INTRO;

begintalknode;
	state = 29;
	nextstate = -1;
	condition = gf(99,15) > 0;
	question = "_I could use more help._";
	text1 = "_I don't want to help you anymore! Find another gremlin! Go away!_";
	action = END_TALK;
	
begintalknode;
	state = 29;
	nextstate = 30;
	condition = gf(99,15) == 0;
	question = "_Why are you here, gremlin?_";
	text1 = "It gives you a toothy little grin. _I should be helping you get further into the grove!_";

begintalknode;
	state = 30;
	nextstate = 31;
	question = "_Get on with it, then._";
	text1 = "_But just being helpful wouldn't be very gremlinish, now, would it?_ It emits a little high-pitched laugh. _Tell you what... I'll help you if you can answer my riddle._";

begintalknode;
	state = 31;
	nextstate = 32;
	question = "_What's the riddle?_";
	text1 = "_I have a thousand little knives, my hands are red and white. You can give them to your maid, to make things turn out right. What am I?_";

begintalknode;
	state = 32;
	nextstate = -1;
	condition = 1;
	question = "_A flower._";
	text1 = "_Oh, you're so smart. Be more specific, dummy!_";

begintalknode;
	state = 32;
	nextstate = -1;
	condition = 1;
	question = "_A tulip._";
	text1 = "_No! You are wrong! You are not smart!_ The gremlin throws a handful of pollen into the air. You start to feel dizzy.";
	action = END_TALK;
	code =
		sf(99,16,1);
	break;

begintalknode;
	state = 32;
	nextstate = -1;
	condition = 1;
	question = "_A dandelion._";
	text1 = "_No! You are wrong! You are not smart!_ The gremlin throws a handful of pollen into the air. You start to feel dizzy.";
	action = END_TALK;
	code =
		sf(99,16,1);
	break;

begintalknode;
	state = 32;
	nextstate = -1;
	condition = 1;
	question = "_A rose._";
	text1 = "_Correct! In return, I shall tell you this ... proceed on the path with the gravel at the entrance. Otherwise, you'll get beaten on._";
	action = END_TALK;
	code =
		sf(99,15,1);
	break;

begintalknode;
	state = 32;
	nextstate = -1;
	condition = 1;
	question = "_A tree._";
	text1 = "_No! You are wrong! You are not smart!_ The gremlin throws a handful of pollen into the air. You start to feel dizzy.";
	action = END_TALK;
	code =
		sf(99,16,1);
	break;

begintalknode;
	state = 32;
	nextstate = -1;
	condition = 1;
	question = "_I have no idea._";
	text1 = "_If you were smarter, you might know. As it is, you will have to go on without my wisdom._";
	action = END_TALK;

// Second Gremlin

begintalknode;
	tag = 80;
	state = -1;
	nextstate = 57;
	question = "Second Gremlin";
	text1 = "An unusually tall gremlin, a full 3 feet, is waiting here for you. It says _1234._ You aren't sure why.";
	text5 = "The gremlin stares at you, bored. Again, it says _1234._";
	action = INTRO;

begintalknode;
	state = 57;
	nextstate = -1;
	condition = gf(99,17) > 0;
	question = "_I want to talk to you more._";
	text1 = "_7890. 1234. 5678._ The gremlin sounds very tired of you.";
	action = END_TALK;

begintalknode;
	state = 57;
	nextstate = -1;
	condition = gf(99,12) > 0;
	question = "_I want to talk to you more._";
	text1 = "It doesn't say anything. Something you said earlier offended it.";
	action = END_TALK;

begintalknode;
	state = 57;
	nextstate = 58;
	condition = gf(99,12) == 0;
	question = "_Um, hi. Why are you standing here?_";
	text1 = "_6789. 2345._ You aren't sure what it wants to be saying. Maybe that is the point.";


begintalknode;
	state = 58;
	nextstate = 59;
	condition = gf(99,12) == 0;
	question = "_1234. 3456._";
	text1 = "_4567. 2345!_";

begintalknode;
	state = 58;
	nextstate = -1;
	question = "_1345?_";
	text1 = "The gremlin suddenly looks very offended. You aren't sure what you said. It doesn't speak anymore.";
	action = END_TALK;
	code =
		sf(99,12,1);
	break;

begintalknode;
	state = 58;
	nextstate = 59;
	condition = gf(99,12) == 0;
	question = "_2345._";
	text1 = "It looks offended. _4567!_";

begintalknode;
	state = 59;
	nextstate = -1;
	condition = gf(99,12) == 0;
	question = "_4567._";
	text1 = "_1234! 1234!_ It pauses. _2345._";

begintalknode;
	state = 59;
	nextstate = -1;
	question = "_9876!_";
	text1 = "The gremlin suddenly looks very offended. You aren't sure what you said. It doesn't speak anymore.";
	action = END_TALK;
	code =
		sf(99,12,1);
	break;

begintalknode;
	state = 59;
	nextstate = 60;
	condition = gf(99,12) == 0;
	question = "_7890._";
	text1 = "It looks intrigued. _5678?_";

begintalknode;
	state = 60;
	nextstate = -1;
	condition = gf(99,12) == 0;
	question = "_2345._";
	text1 = "_2345. 2345._";

begintalknode;
	state = 60;
	nextstate = -1;
	condition = gf(99,12) == 0;
	question = "_5678._ ";
	text1 = "_7890!_ says the gremlin excitedly. It points at the path covered with flowers. _5678! 5678!_ It looks pleased that it's been so helpful.";
	action = END_TALK;
	code =
		sf(99,17,1);
	break;

begintalknode;
	state = 60;
	nextstate = -1;
	question = "_Hmm. 4578?_";
	text1 = "The gremlin suddenly looks very offended. You aren't sure what you said. It doesn't speak anymore.";
	action = END_TALK;
	code =
		sf(99,12,1);
	break;

begintalknode;
	state = 58;
	nextstate = -1;
	question = "_1452._";
	text1 = "The gremlin suddenly looks very offended. You aren't sure what you said. It doesn't speak anymore.";
	action = END_TALK;
	code =
		sf(99,12,1);
	break;

// Third Gremlin

begintalknode;
	tag = 100;
	state = -1;
	nextstate = 85;
	question = "Third Gremlin";
	text1 = "A gremlin looks at you enigmatically. _I don't have a name. But at least my name isn't a number!_";
	text5 = "The gremlin looks at you enigmatically. ";
	action = INTRO;

begintalknode;
	state = 85;
	nextstate = -1;
	question = "_A name made of numbers?_";
	text1 = "_One of the gremlins in the grove only talks in numbers! What an idiot!_";

begintalknode;
	state = 85;
	nextstate = 86;
	question = "_Why are you here?_";
	text1 = "_I'm here to help you rescue the grove._";

begintalknode;
	state = 86;
	nextstate = 87;
	question = "_Help away._";
	text1 = "_Yep. Of course, I'm a gremlin. I don't want to be too useful. I can give you a hint, though!_";

begintalknode;
	state = 87;
	nextstate = -1;
	question = "_Why not? Don't you realize your home and life are in danger?_";
	text1 = "It laughs. _We're just not friendly creatures!_ It kicks you in the shin, just to punctuate the point.";

begintalknode;
	state = 87;
	nextstate = 88;
	question = "_I understand. What is your hint?_";
	text1 = "It grins enigmatically, and points straight north.";

begintalknode;
	state = 88;
	nextstate = -1;
	question = "_And what am I supposed to get out of that?_";
	text1 = "_Nothing, I guess. Now go away._";
	action = END_TALK;

begintalknode;
	state = 88;
	nextstate = -1;
	question = "_Thank you._";
	text1 = "_You're welcome. Now go away._";
	action = END_TALK;

